package o;

public final class aha {
    public static int ॱ(byte[] bArr, int i, int i2) {
        while (i < i2 && bArr[i] != (byte) 71) {
            i++;
        }
        return i;
    }

    public static long ˊ(anc o_anc, int i, int i2) {
        int i3 = 1;
        o_anc.ˋ(i);
        if (o_anc.ˊ() < 5) {
            return -9223372036854775807L;
        }
        int ॱᐝ = o_anc.ॱᐝ();
        if ((8388608 & ॱᐝ) != 0 || ((2096896 & ॱᐝ) >> 8) != i2) {
            return -9223372036854775807L;
        }
        if (((ॱᐝ & 32) != 0 ? 1 : 0) == 0 || o_anc.ʽ() < 7 || o_anc.ˊ() < 7) {
            return -9223372036854775807L;
        }
        if ((o_anc.ʽ() & 16) != 16) {
            i3 = 0;
        }
        if (i3 == 0) {
            return -9223372036854775807L;
        }
        byte[] bArr = new byte[6];
        o_anc.ˎ(bArr, 0, bArr.length);
        return ˋ(bArr);
    }

    private static long ˋ(byte[] bArr) {
        return (((((((long) bArr[0]) & 255) << 25) | ((((long) bArr[1]) & 255) << 17)) | ((((long) bArr[2]) & 255) << 9)) | ((((long) bArr[3]) & 255) << 1)) | ((((long) bArr[4]) & 255) >> 7);
    }
}
